home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DDJ0192.ARJ / DISPLAY.H < prev    next >
C/C++ Source or Header  |  1991-08-30  |  3KB  |  83 lines

  1. /****************************************************************
  2.  *                                                              *
  3.  * DISPLAY.H header for DISPLAY.C, a text display library       *
  4.  * See also DISPLAY.C DIRPICK.C, and HISTO.C                    *
  5.  * Al Williams                                                  *
  6.  *                                                              *
  7.  ****************************************************************/
  8.  
  9. #ifndef DISPLAY_HEADER
  10. #define DISPLAY_HEADER 1
  11.  
  12. /* global variables */
  13. extern int colors[];  /* color set */
  14. extern int color;     /* current color */
  15. extern int mono;      /* mono monitor detected */
  16.  
  17. /* defines for color values */
  18. #define TEXTCOLOR colors[0]   /* normal */
  19. #define SOCOLOR colors[1]     /* stand out */
  20. #define ERRCOLOR colors[2]    /* error color */
  21. #define HELPCOLOR colors[3]   /* help color */
  22.  
  23. /* shortcut defines */
  24. /* write 1 character */
  25. #define writec(a) writecc(a,1)
  26. /* clear entire screen */
  27. #define cls() clears(0,0,79,24)
  28. /* clear to end of line */
  29. #define clreol() writecc(' ',80)
  30. /* hide cursor */
  31. #define curshide() goxy(255,255)
  32. /* advisiory (error message) */
  33. #define advise_at(x,y,msg) prompt_at(x,y,msg,"",ERRCOLOR)
  34. /* ask_at bottom line */
  35. #define ask(p,v,c,l,b,h) ask_at(0,24,p,v,c,l,b,h)
  36. /* prompt_at bottom line */
  37. #define prompt(p,r,c) prompt_at(0,24,p,r,c)
  38. /* advisory (error) message at bottom line */
  39. #define advise(m) advise_at(0,24,m)
  40. /* get a file name on bottom line */
  41. #define getfilen(f,l) getfilen_at(0,24,f,l)
  42.  
  43.  
  44. /* prototypes */
  45. /* set video mode (do this 1st) */
  46. void vidmode(void);
  47. /* printf using writec */
  48. int printfc(char *fmt,...);
  49. /* clear screen region */
  50. void clears(int x0, int y0,int x1,int y1);
  51. /* goto xy */
  52. void goxy(int x,int y);
  53. /* get xy */
  54. void getxy(int *x,int *y);
  55. /* write mutliple characters (handles \a\n\r, backspace */
  56. void writecc(int c,int count);
  57. /* write string */
  58. void writes(char *s);
  59. /* prompt for a key */
  60. int prompt_at(int x, int y, char *str,char *resp,int pcolor);
  61. /* ask for input */
  62. int ask_at(int x, int y, char *promptstr,char *valid,
  63.       int clr,int len,char *buf,char *help);
  64. /* save video */
  65. void vidsave(void);
  66. /* restore video */
  67. void vidrestore(void);
  68. /* get a file name w/menu pick */
  69. int getfilen_at(int x, int y,char *fn,int len);
  70. /* menu pick directory */
  71. char *dirpick(char *spec);
  72. /* save current drive/directory */
  73. void cdsave(void);
  74. /* restore current drive/directory */
  75. void cdrestore(void);
  76. /* draw histograms */
  77. void histogram(int n,int maxm);
  78. #endif
  79.  
  80.  
  81.  
  82.  
  83.